<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="t" uri="http://tiles.apache.org/tags-tiles"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="security" uri="http://www.springframework.org/security/tags" %>


<!-- /section:settings.box -->
<div class="page-header">
    <h1>
        ${pageTitle}
        <small>
            <i class="ace-icon fa fa-angle-double-right"></i>
            ${pageDescription}
        </small>
    </h1>
</div><!-- /.page-header -->
<!-- /section:settings.box -->
<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
         <table class="table table-bordered table-striped table-hover">
            <thead>
                <tr>
                    <th><i class="icon-caret-right blue"></i>Posto</th>
                    <th><i class="icon-caret-right blue"></i>Nome</th>
                    <th><i class="icon-caret-right blue"></i>Login</th>
                    <th><i class="icon-caret-right blue"></i>Email</th>
                    <th><i class="icon-caret-right blue"></i>Organização</th>
                    <th></th>

                </tr>
            </thead>

            <tbody>
                <c:forEach var="item" items="${dataList}">
                    <s:url value="/users/edit" var="edit_url">
                        <s:param name="uid" value="${item.uid}" />
                    </s:url>
                    <s:url value="/users/remove" var="remove_url">
                        <s:param name="uid" value="${item.uid}" />
                    </s:url>
                    <s:url value="/users/detail" var="detail_url">
                        <s:param name="uid" value="${item.uid}" />
                    </s:url>
                    <tr>
                        <td class="align-middle"><a href="${detail_url}">${item.title}</a></td>
                        <td class="align-middle"><a href="${detail_url}">${item.name}</a></td>
                        <td class="align-middle">
                            <a href="${detail_url}">${item.login}</a>
                        </td>
                        <td class="align-middle"><a href="${detail_url}">${item.email}</a></td>
                        <td class="align-middle"><a href="${detail_url}">${item.organization}</a></td>
                        <td class="align-middle">

                            <div class="btn-group">
                                <button data-toggle="dropdown" class="btn btn-sm dropdown-toggle">
                                    Ações
                                    <span class="ace-icon fa fa-caret-down icon-on-right"></span>
                                </button>

                                <ul class="dropdown-menu dropdown-info dropdown-menu-right">
                                    <li>
                                        <a href="${detail_url}">Detalhes</a>
                                    </li>

                                    <li>
                                        <a href="${edit_url}">Editar</a>
                                    </li>

                                    <li>
                                        <a href="${remove_url}" class="remove" confirm="Tem certeza de que deseja excluir este usuário?">Excluir</a>
                                    </li>

                                </ul>
                            </div>


                        </td>

                    </tr>
                </c:forEach>
                <tr class="info">
                    <td colspan="6"><b>Total: </b> ${total}</td>
                </tr>
            </tbody>
        </table>
       <a href="<s:url value="/users/new"/>" class="btn btn-primary">
            <i class="ace-icon fa fa-plus-circle align-top bigger-125"></i>
            Novo Usuário
        </a>
        <!-- PAGE CONTENT ENDS -->
    </div><!-- /.col -->
</div><!-- /.row -->



<!-- inline scripts related to this page -->

<script type="text/javascript">

</script>


